﻿using System.Collections.Specialized;
using System.Xml;
using SqlMapper.SqlElements;

namespace SqlMapper.Serializers
{
    public sealed class IsNotEqualDeSerializer : IDeSerializer
    {
        public BaseTag Deserialize(XmlNode node)
        {
            IsNotEqual isNotEqual = new IsNotEqual();

            NameValueCollection prop = NodeUtils.ParseAttributes(node);
            isNotEqual.Prepend = NodeUtils.GetStringAttribute(prop, "prepend");
            isNotEqual.Property = NodeUtils.GetStringAttribute(prop, "property");
            isNotEqual.CompareProperty = NodeUtils.GetStringAttribute(prop, "compareProperty");
            isNotEqual.CompareValue = NodeUtils.GetStringAttribute(prop, "compareValue");
            isNotEqual.Sql = NodeUtils.GetStringAttribute(prop, "sql");

            return isNotEqual;
        }
    }
}
